//无缓存
function computed(val){
	return val < 2 ? val : computed(val-1) + computed(val-2)
}
//缓存
function getVal(val,cache={}){
	if(val in cache){
		return cache[val];
	}
	if(val < 2){
		return val;
	}
	cache[val] = getVal(val-1,cache) + getVal(val-2,cache)
	return cache[val];
}
console.log(getVal(4))